﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.Entities.Enumerator;
using PPI.Entities.Interface;
using PPI.Entities.Lookup;
using VMind.Global;

namespace PPI.Entities.Settings.Mobile
{
    public abstract class EMobileSettingsBase
    {
        protected DatabaseTypes m_DatabaseType;
        protected EHandheld m_Handheld;
        protected EDatabaseType m_DatabaseTypeName;
        protected EMobileVersion m_MobileVersion;
        protected int m_TimeZone;
        protected List<IMobileSetting> m_ListMobileSettings;
        private EVendor m_Vendor;
        private EVendor_Contact m_Contact;
        private EVendor_Project m_Project;

        #region Properties

        public EHandheld Handheld
        {
            get { return m_Handheld; }
            set { m_Handheld = value; }
        }

        public EVendor Vendor
        {
            get { return m_Vendor; }
            set { m_Vendor = value; }
        }

        public EVendor_Contact Contact
        {
            get { return m_Contact; }
            set { m_Contact = value; }
        }

        public EVendor_Project Project
        {
            get { return m_Project; }
            set { m_Project = value; }
        }

        #endregion

        public EMobileSettingsBase()
        {
            m_Vendor = new EVendor();
            m_Contact = new EVendor_Contact();
            m_Project = new EVendor_Project();
            m_Handheld = new EHandheld();
            m_ListMobileSettings = new List<IMobileSetting>();

        }

        public List<IMobileSetting> ListMobileSettings
        {
            get { return m_ListMobileSettings; }
        }

        public DatabaseTypes DatabaseType
        {
            get { return m_DatabaseType; }
        }

        public EMobileSettingsBase(EHandheld Handheld, string mobileVersion, EVendor_Project project, EVendor_Contact contact, EVendor vendor) : this(Handheld,mobileVersion)
        {
            m_Vendor = vendor;
            m_Contact = contact;
            m_Project = project;
            m_ListMobileSettings.Add(m_Vendor);
            m_ListMobileSettings.Add(m_Contact);
            m_ListMobileSettings.Add(m_Project);
        }

        public EMobileSettingsBase(EHandheld Handheld, string mobileVersion, EVendor_Contact contact, EVendor vendor)
            : this(Handheld, mobileVersion)
        {
            m_Vendor = vendor;
            m_Contact = contact;
            m_ListMobileSettings.Add(m_Vendor);
            m_ListMobileSettings.Add(m_Contact);
        }

        public EMobileSettingsBase(EHandheld Handheld, string mobileVersion)
        :this()
        {
            m_TimeZone = -3;
            m_Handheld = Handheld;
            m_MobileVersion = new EMobileVersion(mobileVersion);
            
            m_ListMobileSettings.Add(Handheld);
            m_ListMobileSettings.Add(m_MobileVersion);
        }


        protected  void SetDatabaseTypeName()
        {
            m_DatabaseTypeName = new EDatabaseType(m_DatabaseType.ToString());
        }

        /// <summary>
        /// CO 1.20
        /// Metodo abstracto , la cual seria el encargado de agregar las logicas necesarias a la lista de ListMobileSettings
        /// ver PPI.Entities.Settings.Mobile.EMobileSettingsGPS.cs
        /// ver PPI.Entities.Interface.IMobileSetting.cs
        /// </summary>
        public abstract void ConfigurateConfig();
    }
}
